<template>
  <el-container class="layout-container-demo" style="height: 100vh">
    <el-main>
      <el-scrollbar>
        <el-table :data="tableData">
          <el-table-column prop="id" label="评价编号" />
          <el-table-column prop="orderId" label="订单Id" />
          <el-table-column prop="commodityScoreList" label="商品评分List" />
          <el-table-column prop="logisticsScore" label="物流评分" />
          <el-table-column prop="shopScore" label="店铺评分" />
          <el-table-column prop="detailsList" label="商品评价内容List" />
          <el-table-column label="操作">
            <template #default="scope">
            <el-button @click="openOrderEvaluateDialog(scope.row.id)">
              编辑
            </el-button>
          </template>
          </el-table-column>
        </el-table>
      </el-scrollbar>
    </el-main>
  </el-container>
  <evaluate-c-u ref="evaluateCURef" />
</template>
  
<script lang="ts" setup>
import { ref } from 'vue'
import { getEvaluateByJwt } from "../../api/evaluate/"
import { ElContainer } from 'element-plus';
import EvaluateCU from './EvaluateCU.vue'

// 打开订单评价页面
let evaluateCURef = ref()
const openOrderEvaluateDialog = (id: number) => {
  //子组件方法
  evaluateCURef.value.openDialog(id,null);
}

// 获取个人优惠卷
const evaluate = getEvaluateByJwt({})
let tableData = ref([])
evaluate.then((res) => {
  if (res.code === 200) {
    tableData.value = res.data
  }
})


</script>
  
<style scoped>
.layout-container-demo .el-header {
  position: relative;
  background-color: var(--el-color-primary-light-7);
  color: var(--el-text-color-primary);
}

.layout-container-demo .el-aside {
  color: var(--el-text-color-primary);
  background: var(--el-color-primary-light-8);
}

.layout-container-demo .el-menu {
  border-right: none;
}

.layout-container-demo .el-main {
  padding: 0;
}

.layout-container-demo .toolbar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  right: 20px;
}
</style>
  